package com.ruoyi.system.api;

import com.ruoyi.common.core.constant.ServiceNameConstants;
import com.ruoyi.common.core.domain.R;
import com.ruoyi.system.api.domain.CountryTwoCode;
import com.ruoyi.system.api.factory.RemoteUserFallbackFactory;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

@FeignClient(contextId = "remoteCountryCodeService", value = ServiceNameConstants.SYSTEM_SERVICE)
public interface RemoteCountryCodeService {

    /**
     * 根据二字码获取国家信息
      * @param code
     * @return
     */    
    @GetMapping("/system/countryTwoCode/getCountryByCode")
    CountryTwoCode getCountryByCode(@RequestParam("code") String code);

    /**
     * 根据国家中文名获取国家二字码
     * @param countryCn
     * @return
     */
    @GetMapping("/system/countryTwoCode/getByCountryCn/{countryCn}")
    R<Object> getByCountryCn(@PathVariable("countryCn") String countryCn);
}
